<section class="content-header">
    <h1>{{edit ? "修改景点" : "创建景点"}}</h1>
</section>

<section class="content">
    <div class="box box-primary">
        <form class="form-horizontal" name="spots_creat_form" novalidate="novalidate" ng-submit="spotsCreatForm()">
            <div class="box-body">
                <div class="form-group pt7" ng-class="{'has-success': spots_creat_form.code.$dirty && spots_creat_form.code.$valid && !spots_creat_form.code.$focused, 'has-error': spots_creat_form.code.$dirty && spots_creat_form.code.$invalid && !spots_creat_form.code.$focused}">
                    <label for="code" class="col-sm-2 control-label">景点编号</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="code" name="code" ng-model="spot.code" placeholder="景区编号" ng-focus required />
                    </div>
                </div>
                <div class="form-group" ng-class="{'has-success': spots_creat_form.name.$dirty && spots_creat_form.name.$valid && !spots_creat_form.name.$focused, 'has-error': spots_creat_form.name.$dirty && spots_creat_form.name.$invalid && !spots_creat_form.name.$focused}">
                    <label for="name" class="col-sm-2 control-label">景点名称</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="name" name="name" ng-model="spot.name" placeholder="景区名称" ng-focus required />
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': spots_creat_form.brief.$dirty && spots_creat_form.brief.$valid && !spots_creat_form.brief.$focused, 'has-error': spots_creat_form.brief.$dirty && spots_creat_form.brief.$invalid && !spots_creat_form.brief.$focused}">
                    <label for="brief" class="col-sm-2 control-label">景点简介</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="brief" name="brief" ng-model="spot.brief" placeholder="景点简介" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">景点封面</label>
                    <div class="col-sm-9 pt7">
                        <div class="img-content" ng-show="spot.images.length" style="margin-bottom: 10px;">
                            <span class="pull-left">原封面：</span>
                            <span class="img-block" ng-repeat="spot_img in spot.images track by $index">
                                <img ng-src="{{spot_img}}?imageView2/2/w/100/h/100" width="100" height="100" />
                                <i class="fa fa-remove" ng-click="spot.images.splice($index, 1)"></i>
                            </span>
                        </div>
                        <uploader-img val="spot.images" multi="true"></uploader-img>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">景点录音</label>
                    <div class="col-sm-9">
                        <div class="audio-content pt7" ng-show="spot.audio != null" style="margin-bottom: 10px;">
                            <span class="pull-left">原录音：</span>
                            <audio controls ng-src="{{sce(spot.audio.url)}}">您的浏览器不支持audio标签</audio>
                            <button type="button" class="btn btn-danger audio-delete" ng-click="deleteAudio()">删除原录音</button>
                        </div>
                        <uploader-audio val="spot.audio_id"></uploader-audio>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">景点内容</label>
                    <div class="col-sm-9">
                        <textarea id="editor"></textarea>
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary pull-right" ng-disabled="spots_creat_form.$invalid">{{edit ? "修 改" : "创 建"}}</button>
            </div>
        </form>
    </div>
</section>